import { lazy } from "react"
// 导入路由表
const Login = lazy(() => import("../page/Login"))
const Home = lazy(() => import("../page/Home"))
const Order = lazy(() => import("../page/Order"))
const Menu = lazy(() => import("../page/Menu"))
const Notfound = lazy(() => import("../page/Error"))
// 子级路由表
export const childrenRouter = [
  {
    path: "/",
    element: <Order />,
  },
  {
    path: "/menu",
    element: <Menu />,
  },
]
// 搭建路由表
export const router = [
  {
    path: "/",
    element: <Home />,
    children: childrenRouter,
  },
  {
    path: "/login",
    element: <Login />,
  },
  {
    path: "*",
    element: <Notfound />,
  },
]
